projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3fd46c
)
macos: be tolerant of NULL GL context
author
Christian Hergert
<chergert@redhat.com>
Thu, 29 Oct 2020 16:46:02 +0000
(09:46 -0700)
committer
Christian Hergert
<chergert@redhat.com>
Thu, 29 Oct 2020 17:57:02 +0000
(10:57 -0700)
Some code appears to unconditionally attempt to make the context current,
so this makes things tolerant to a NULL GdkGLContext and just return FALSE.
gdk/macos/gdkmacosdisplay.c
patch
|
blob
|
history
diff --git
a/gdk/macos/gdkmacosdisplay.c
b/gdk/macos/gdkmacosdisplay.c
index 6a89def8c1636b90bd285af438eccdcd1a94ae29..665a567e70ec0e3399c278f7d171703a6c7da9b3 100644
(file)
--- a/
gdk/macos/gdkmacosdisplay.c
+++ b/
gdk/macos/gdkmacosdisplay.c
@@
-649,7
+649,10
@@
gdk_macos_display_make_gl_context_current (GdkDisplay *display,
GdkGLContext *gl_context)
{
g_assert (GDK_IS_MACOS_DISPLAY (display));
- g_assert (GDK_IS_MACOS_GL_CONTEXT (gl_context));
+ g_assert (!gl_context || GDK_IS_MACOS_GL_CONTEXT (gl_context));
+
+ if (gl_context == NULL)
+ return FALSE;
return _gdk_macos_gl_context_make_current (GDK_MACOS_GL_CONTEXT (gl_context));
}